import { FieldType } from '@/interface';

export default ({
  projectId,
  id,
}:{
projectId:string,
id:string,
}) :object => ({
  autoQuery: false,
  autoCreate: true,
  selection: 'single' as any,
  primaryKey: 'id',
  paging: false,
  parentField: 'id',
  expandField: 'expand',
  fields: [
    {
      name: 'id',
      type: 'string' as FieldType,
    },
    // {
    //   name: 'name',
    //   type: 'string' as FieldType,
    // },
    // {
    //   name: 'status',
    //   type: 'string' as FieldType,
    // },
    // {
    //   name: 'stageRecordList',
    //   type: 'object' as FieldType,

    // },
    // {
    //   name: 'trigger',
    //   type: 'object' as FieldType,

    // },
    // {
    //   name: 'triggerType',
    //   type: 'string' as FieldType,
    // },
    // {
    //   name: 'finishedDate',
    //   type: 'string' as FieldType,
    // },
    // {
    //   name: 'staredDate',
    //   type: 'string' as FieldType,
    // },
    // {
    //   name: 'enable',
    //   type: 'boolean' as FieldType,
    // },
  ],
  transport: {
    read: {
      url: `devops/v1/projects/${projectId}/pipeline_records/paging?pipeline_id=${id}`,
      method: 'get',
    },
  },
  events: {

  },
});
